﻿/*****************************************************************************
	SNEGA STG GAME ENGINE 0.7a
	Copyright (C) 2009, Xiaohan Tian (snega0223)
	
	http://code.google.com/p/sng-actionscript-stg-engine/
	
	This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License(LGPL) as
	published by the Free Software Foundation, either version 3 of the 
	License, or(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Lesser General Public License for more details.
	
	You should have received a copy of the GNU Lesser General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/

package com.sng.stg.game.enemy.action 
{
	import com.sng.stg.game.bullet.EnemyBullet;
	import com.sng.stg.game.enemy.Enemy;
	import com.sng.stg.game.event.ContinuousEnemyBulletGenerator;
	import com.sng.stg.game.StageViewer;
	import flash.display.BitmapData;
	
	/**
	 * ...
	 * @author snega
	 */
	public class EnemyConFireType1 extends EnemyAction
	{
		protected var _bitmapData:BitmapData = null;
		protected var _pixelSnapping:String = "auto";
		protected var _smoothing:Boolean = false;
		
		protected var _duration:int, _angel:int, _step:int, _speed:int, _radius:Number;
		
		protected var _event:ContinuousEnemyBulletGenerator = null;
		
		public function EnemyConFireType1(monitorLife:Boolean, value:int, enemy:Enemy, duration:int = 60, angel:int = 0, step:int = 0, speed:int = 0, radius:Number = 1, bitmapData:BitmapData = null, pixelSnapping:String = "auto", smoothing:Boolean = false) 
		{
			super(monitorLife, value, enemy);
			
			this._bitmapData = bitmapData;
			this._pixelSnapping = pixelSnapping;
			this._smoothing = smoothing;
			
			this._angel = angel;
			this._step = step;
			this._duration = duration;
			this._speed = speed;
			
			this._radius = radius;
			
			this._event = new ContinuousEnemyBulletGenerator(this._enemy, this._duration, this._angel, this._step, this._speed, this._radius, this._bitmapData, this._pixelSnapping, this._smoothing);
		}
		
		override public function execute():void {
			trace("[Action] (" + this._time + ") Hit EnemyConFireType1.");
			
			this._enemy._currContinuousEvent = this._event;
			this._event.start(this._enemy._currStage);
			this._enemy._currStage._continuousEventList.push(this._event);
		}
		
	}
	
}